<template>
  <header>
    <section>
      <label for="title">ToDoList</label>
      <input type="text" id="title" name="title" placeholder="添加ToDo" required="required" autocomplete="off" v-model.trim="name" @keyup.enter="add"/>
    </section>
  </header>
</template>

<script>
export default {
  data(){
      return {
          name:''
      }
  },
  methods:{
      add(){
          this.$emit('add',this.name)
          this.name = ''
      }
  }
}
</script>

<style>

</style>